package com.seek.springevent.listen;

import com.seek.springevent.event.LoanAuditEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * 模拟个推消息推送业务
 */
@Component
public class PushMessageListener implements ApplicationListener<LoanAuditEvent> {

    Logger logger = LoggerFactory.getLogger(PushMessageListener.class);
    @Override
    public void onApplicationEvent(LoanAuditEvent loanAuditEvent) {
        logger.info("==========开始推送消息=============");
        try {
            Thread.sleep(1000L);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        logger.info("==========消息推送结束=============");
        logger.info("==========消息推送耗时1s============");
    }
}
